package jwr.ex4;

public class ShiritoriVO {
	private String firstWord="아버지";  //전에 있는 단어
	private String secondWord;         // 다른 사람이 받아오는 단어
	private String wordOfHead;           // secondWord의 앞글자
	private String wordOfRear;           // firstWord의 맨 뒷 글자
	public ShiritoriVO() {
	}
	public String getFirstWord() {
		return firstWord;
	}
	public void setFirstWord(String firstWord) {
		this.firstWord = firstWord;
	}
	public String getSecondWord() {
		return secondWord;
	}
	public void setSecondWord(String secondWord) {
		this.secondWord = secondWord;
	}
	public String getWordOfHead() {
		return wordOfHead;
	}
	public void setWordOfHead() {
		this.wordOfHead = getFirstWord().substring(0, 1);
	}
	public String getWordOfRear() {
		return wordOfRear;
	}
	public void setWordOfRear() {
		this.wordOfRear = getSecondWord().substring(getSecondWord().length()-1);
	}
	@Override
	public String toString() {
		return "ShiritoriVO [firstWord=" + firstWord + ", secondWord="
				+ secondWord + ", wordOfHead=" + wordOfHead + ", wordOfRear="
				+ wordOfRear + "]";
	}
	
}
